The tgrind Style Option

It is useful to be able to include program fragments as figures in a text. The tgrind style option can be used to accomplish this fairly painlessly by defining the \tagrind command.

The \tagrind command has the following proforma:
 \tagrind*[loc]{file}{caption }{label }

As usual,

The listing file should be generated using tgrind and removing the first and last lines of the resulting file. For example, if the C source file file.c were to be used as a listing,

     tgrind -f -lc file.c | sed -e 1d -e \$d >file.tex
would generate a file file.tex suitable for use with tagrind. For example,
\tagrind{file}{This is an example}{eg}